<template>
	<view class="status-bar" :style="{height:statusBarHeight+'px'}" ref="statusBar">
     
	</view>
</template>

<script>
	export default {
		name:'hsStatusbar',
		props: {
			height: {
				type: Number || null,
				default: 0
			},
			type: {
				type: String,
				default: '', //capsule
			},
		},
		data(){
			return {
				statusBarHeight:0,
				boxHeight: uni.getMenuButtonBoundingClientRect().height +
					8 +
					uni.getWindowInfo().statusBarHeight,
			}
		},
		created() {
			if(this.type == 'capsule'){
				this.statusBarHeight = (this.height + this.boxHeight)
			}else{
				this.statusBarHeight = (this.height + uni.getWindowInfo().statusBarHeight)
			}
		},
		mounted() {
			uni.setStorageSync('statusBarHeight',this.statusBarHeight)
		} 
		
	}
</script>

<style lang="scss">
	.status-bar {
		width: 100%;
		background: #fff;
		// height: var(--status-bar-height);
		// height: 200px;
		// background: red;
	}
</style>
